
module Debugout

LEVEL_DEBUG_MORE = -1
LEVEL_DEBUG = 0
LEVEL_INFO  = 1
LEVEL_ERROR = 2

@@output_level = 0

def set_output_level(level)
  @@output_level = level
end

def puts(level, str)
  if level >= @@output_level then
    STDERR.puts("DOUT #{caller.first} : #{str}")
  end
end

module_function :set_output_level
module_function :puts
end

